
package nav;

public class LinkImpl implements Link{

	private int id;
	private int from;
	private int to;
	
	private Street street;
	private int numberOnStreetLineString;
	private int length;
	
    public LinkImpl(int id, int from, int to,int length) {
    	this.id=id;
    	this.from = from;
    	this.to=to;
    	this.length=length;
    }

	@Override
	public Integer crossingTo() {
		return to;
	}

	@Override
	public int length() {
		return length;
	}

	@Override
	public void setStreet(Street street, int pointNr) { 	
    	this.street = street;
    	this.numberOnStreetLineString = pointNr;
	}

	@Override
	public int crossingFrom() {
    	return from;
	}

	@Override
	public Street getStreet() {
		return street;
	}

	@Override
	public void setPointNr(int n) {
		this.numberOnStreetLineString=n;
	}
	
	@Override
	public String toString(){
		String r = "ID: " + id +", From: "+ from + " To: "+ to+ " Length: "+ length + "Street: "+ street + "PointNr: "+ numberOnStreetLineString+"!!!\n";
		return r;
	}
	
	@Override
	public int getID() {
		return id;
	}
	
	@Override
	public int getPointNr(){
		return numberOnStreetLineString;
	}
}
